#include "stdafx.h"
#include "editorstate.h"
#include "gamemanager.h"
#include "map/MapManager.h"
#include "inputmanager.h"
#include "ObjectManager.h"
#include "Scene.h"
#include "terrain.h"

CEditorState::CEditorState()
{

}

CEditorState::~CEditorState()
{

}

void CEditorState::RunOneFrame( int diff )
{
    CInputManager::Instance().Update(diff);
    CMapManager::Instance().Update(diff);
    CObjectManager::Instance().Update( diff );


    if(NULL==CD3DManager::Instance().GetDevice())
        return;
    CD3DManager::Instance().Clear();

    CD3DManager::Instance().BeginRender();
    CMapManager::Instance().RenderMap();
    CTerrain::Instance().Render();
    CObjectManager::Instance().Render();
    CScene::Instance().Render();

    CD3DManager::Instance().EndRender();
}

IGameState * CEditorState::Create()
{
    static CEditorState state;
    return (IGameState *)&state;
}

void CEditorState::EnterState()
{

}

void CEditorState::ExitState()
{

}
